<template>
  <el-button type="primary">饿了么按钮</el-button>

  <div> ajax的请求结果：{{ result }} </div>
  <div> {{  result.message }}</div>
  <div> 
    {{ reactive_info.data }}
  </div>
</template>

<script setup>
import { ref, reactive } from 'vue';
import { Api } from '../script/Api';

// vue响应式数据
const result = ref({});

let reactive_info = reactive({
  data: {},
});

Api.get('/test/echo', { echo: '黑暗骑士' }, (data) => {
  // 修改响应式数据的值
  result.value = data;
  // reactive不需要通过value属性修改值，但是不支持简单值类型
  reactive_info.data = data;
});
</script>
